package com.zyx.crawlerdemo.fileprocessor.bytestream.test;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @author Yaxi.Zhang
 * @since 2021/8/12 10:53
 * desc: FileInputStream与FileOutputStream案例
 */
public class FisFos {

	public static void main(String[] args) throws IOException {
		/*FileInputStream inputStream = new FileInputStream("data/1.txt");*/
		FileInputStream inputStream = new FileInputStream(new File("data/1.txt"));
		FileOutputStream outputStream = new FileOutputStream("data/out.txt");
		/*FileOutputStream outputStream = new FileOutputStream(new File("data/out.txt"));*/
		int temp;
		while ((temp = inputStream.read()) != -1) {
			System.out.print((char)temp);
			outputStream.write(temp);
		}
		outputStream.close();
		inputStream.close();
	}

}
